#ifndef TASK_H_
#define TASK_H_

#define TASK_STAT_PEND     (0)
#define TASK_STAT_RUNNING  (1)
#define TASK_STAT_END      (2)
#define TASK_STAT_KILLED   (3)

typedef struct _Task
{
	int  taskId;
	int  pid;
	int  status;
	char cmd[PACKAGE_DATA_COMMAND_TASK_LEN];
	struct _Task *before;
	struct _Task *next;
}TASKINFO, *PTASKINFO;

extern void tsk_init();
extern PTASKINFO tsk_getlist();
extern void tsk_add(int id, int pid, char* command);
extern void tsk_remove(int id);
extern PTASKINFO tsk_findbyid(int id);
extern PTASKINFO tsk_findbypid(int pid);
extern void tsk_release();

#endif
